package com.example.demo.Controller;

import com.example.demo.bean.face;
import com.example.demo.bean.faceDao;
import com.example.demo.bean.minface;
import com.example.demo.entity.rejison;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin    //跨域请求
public class faceController {

    @Autowired
    faceDao sc;

    //单个数字      这是弄人脸识别机器用的  可以不用看
    @PostMapping("/face")
    public rejison helloword(@RequestBody face book){
        System.out.println(book);
        rejison re = new rejison();
        book.setFaceImg("图片太长，没法显示");
        book.setIdCardImg("id_card_img,太长，没法显示");
        re.setSuccess("1");
        if(book != null){
            sc.save(book);
            return re;
        }
        re.setSuccess("0");
        return re;
    }

    @PostMapping("/face1")
    public rejison helloword1(@RequestBody minface book){
        System.out.println(book);
        rejison re = new rejison();
        re.setSuccess("1");
        return re;
    }
}
